package com.astoolkit.workflow.task.pipeline
{
	import com.astoolkit.workflow.BasePipelineTask;
	
	public class SetProperty extends BasePipelineTask
	{
		public var target : Object;
		public var property : String;
		override public function begin(inRetain:Boolean=false):void
		{
			super.begin( inRetain );
			if( !target )
				target = _document;
			if( !property || !target.hasOwnProperty( property ) )
			{
				fail( "SetProperty started without a property name or property name not found on target"  );
				return;
			}
			target[ property ] = pipelineData;
			complete();
		}
	}
	
}